#include <gtest/gtest.h>
#include "utils/common_utils.h"

TEST(test_common_utils, test_common_utils_generateNameSpace)
{
    ASSERT_EQ(CommonUtils::generateNameSpace(""), "/");
    ASSERT_EQ(CommonUtils::generateNameSpace("/a"), "/a");
    ASSERT_EQ(CommonUtils::generateNameSpace("a"), "/a");
    ASSERT_EQ(CommonUtils::generateNameSpace("/a/"), "/a");
    ASSERT_EQ(CommonUtils::generateNameSpace("/a//"), "/a");

}

TEST(test_common_utils, test_common_utils_removeBias)
{
    ASSERT_EQ(CommonUtils::removeBias("a"), "a");
    ASSERT_EQ(CommonUtils::removeBias("/a"), "/a");
    ASSERT_EQ(CommonUtils::removeBias("//a"), "/a");
    ASSERT_EQ(CommonUtils::removeBias("///a"), "/a");
    ASSERT_EQ(CommonUtils::removeBias("////a"), "/a");
    ASSERT_EQ(CommonUtils::removeBias("/////a"), "/a");
}
